<%--
  Created by IntelliJ IDEA.
  User: MAVI003
  Date: 2017/3/24
  Time: 11:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">
    <title>拍卖系统</title>
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/images/icon.jpg">
    <link rel="bookmark" href="${pageContext.request.contextPath}/images/icon.jpg">

    <link href="//cdn.bootcss.com/bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://ibootstrap-file.b0.upaiyun.com/www.layoutit.com/css/builder/v3/layoutit.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/layoutit.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/my.css" rel="stylesheet">
    <script type="text/javascript" src="http://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript" src="http://cdn.staticfile.org/jqueryui/1.10.2/jquery-ui.min.js"></script>
    <script type="text/javascript"
            src="http://cdn.staticfile.org/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min.js"></script>
    <script type="text/javascript" src="http://cdn.staticfile.org/twitter-bootstrap/3.0.1/js/bootstrap.min.js"></script>
    <script type="text/javascript"
            src="http://ibootstrap-file.b0.upaiyun.com/www.layoutit.com/js/jquery.htmlClean.js"></script>
    <script type="text/javascript"
            src="http://ibootstrap-file.b0.upaiyun.com/www.layoutit.com/js/builder/v3/scripts.min.js"></script>
    <style type="text/css">
        body{
            background-image: url(${pageContext.request.contextPath}/images/7.jpg);
            background-size:cover;
        }
        .myback{
            background-image: url(${pageContext.request.contextPath}/images/7.jpg);
            background-size:cover;
        }
    </style>
    <script>
        function checkPasswords() {
            var passl = document.getElementById("upassword");
            var pass2 = document.getElementById("repassword");
            if (passl.value != pass2.value)
                passl.setCustomValidity("两次密码必须输入一致！");
            else
                passl.setCustomValidity('');
        }

        $(document).ready(function () {

            $("#picture").change(function () {
                var picture = document.getElementById("picture");
                if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(picture.value))
                {
                    //picture.setCustomValidity("图片类型必须是.gif,jpeg,jpg,png中的一种");
                    alert("图片类型必须是.gif,jpeg,jpg,png中的一种");
                    picture.value='';
                    return false;

                }else {
                    picture.setCustomValidity("");
                }
            })

        })

    </script>
</head>
<body>
<div class="container">

    <div class="row clearfix hideLine">
        <div class="col-md-12 column hideLine myback">
            <jsp:include page="navigation.jsp"></jsp:include>
            <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="${pageContext.request.contextPath}/uploadGoods">
                <ul class="breadcrumb">
                    <li>
                        <a href="#">我的</a>
                    </li>
                    <li>
                        <a href="#">发布拍卖物品</a>
                    </li>
                </ul>

                <div class="form-group">

                    <label for="gname" class="col-sm-2 control-label">商品名称</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" id="gname" name="gname" placeholder="请输入商品名称" required
                               pattern="[a-zA-Z0-9\u4e00-\u9fa5]{0,50}"
                               title="商品名称格式：50个字内，不含特殊符号" value="${name}"/>
                    </div>
                </div>


                <div class="form-group">

                    <label for="price" class="col-sm-2 control-label">最低价格</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" id="price" name="price" placeholder="请输入正确金额格式" required
                               pattern="^(0|[1-9][0-9]{0,9})(\.[0-9]{1,2})?$"
                               title="充值金额：
                               条件一：格式 0232 错误，023.232错误，0.23正确，202.02正确（错误的0开头为错误）
                               条件二：整数最多10位，小数至多2位
                               条件三：成员当然不能为非数字，23.a错误 23.0a错误等
                               条件四：带小数点必须要有小数位，233. 错误"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">种&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类</label>
                    <div class="col-sm-6">
                        <%--<input type="text" class="form-control" id="usex" name="usex"/>--%>
                        <label class="radio">
                            <input type="radio" value="1" name="gkind" checked
                            >
                            书籍
                        </label>
                        <label class="radio">
                            <input type="radio" value="0" name="gkind"
                            >
                            其他
                        </label>

                    </div>
                </div>

                <div class="form-group">
                    <label for="gdetial" class="col-sm-2 control-label">商品描述</label>
                    <div class="col-sm-6">
                            <textarea class="form-control" id="gdetial" name="gdetial" required
                                      placeholder="请填写商品描述，如入手价，入手年限，几成新等。"
                                      maxlength="255"></textarea>
                    </div>

                </div>

                <div class="form-group">
                    <label for="picture" class="col-sm-2 control-label" >商品图片</label>
                    <div class="col-sm-6">
                        <input type="file" id="picture" name ="picture" required  />
                        <p class="help-block">
                            上传商品图片。
                        </p>
                    </div>

                </div>

                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-6">
                        <button type="submit" class="btn btn-default" id="modify">上传</button>
                    </div>
                </div>
            </form>

        </div>
    </div>

</div>
</body>
</html>
